!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.accordion",{version:"1.13.2",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(e){return e.find("> li > :first-child").add(e.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=o(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():o()}},_createIcons:function(){var e,t=this.options.icons;t&&(e=o(""),this._addClass(e,"ui-accordion-header-icon","ui-icon "+t.header),e.prependTo(this.headers),e=this.active.children(".ui-accordion-header-icon"),this._removeClass(e,t.header)._addClass(e,null,t.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"===e?this._activate(t):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t)&&this._createIcons())},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var t=o.ui.keyCode,i=this.headers.length,a=this.headers.index(e.target),s=!1;switch(e.keyCode){case t.RIGHT:case t.DOWN:s=this.headers[(a+1)%i];break;case t.LEFT:case t.UP:s=this.headers[(a-1+i)%i];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:s=this.headers[0];break;case t.END:s=this.headers[i-1]}s&&(o(e.target).attr("tabIndex",-1),o(s).attr("tabIndex",0),o(s).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===o.ui.keyCode.UP&&e.ctrlKey&&o(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=o()):!1===e.active?this._activate(0):this.active.length&&!o.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=o()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var i,e=this.options,t=e.heightStyle,a=this.element.parent();this.active=this._findActive(e.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=o(this),t=e.uniqueId().attr("id"),i=e.next(),a=i.uniqueId().attr("id");e.attr("aria-controls",a),i.attr("aria-labelledby",t)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===t?(i=a.height(),this.element.siblings(":visible").each(function(){var e=o(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=o(this).outerHeight(!0)}),this.headers.next().each(function(){o(this).height(Math.max(0,i-o(this).innerHeight()+o(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.headers.next().each(function(){var e=o(this).is(":visible");e||o(this).show(),i=Math.max(i,o(this).css("height","").height()),e||o(this).hide()}).height(i))},_activate:function(e){e=this._findActive(e)[0];e!==this.active[0]&&(e=e||this.active[0],this._eventHandler({target:e,currentTarget:e,preventDefault:o.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):o()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&o.each(e.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var t=this.options,i=this.active,a=o(e.currentTarget),s=a[0]===i[0],n=s&&t.collapsible,h=n?o():a.next(),r=i.next(),r={oldHeader:i,oldPanel:r,newHeader:n?o():a,newPanel:h};e.preventDefault(),s&&!t.collapsible||!1===this._trigger("beforeActivate",e,r)||(t.active=!n&&this.headers.index(a),this.active=s?o():a,this._toggle(r),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),t.icons&&(h=i.children(".ui-accordion-header-icon"),this._removeClass(h,null,t.icons.activeHeader)._addClass(h,null,t.icons.header)),s)||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),t.icons&&(e=a.children(".ui-accordion-header-icon"),this._removeClass(e,null,t.icons.header)._addClass(e,null,t.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active"))},_toggle:function(e){var t=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=t,this.prevHide=i,this.options.animate?this._animate(t,i,e):(i.hide(),t.show(),this._toggleComplete(e)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),t.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):t.length&&this.headers.filter(function(){return 0===parseInt(o(this).attr("tabIndex"),10)}).attr("tabIndex",-1),t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,i,t){function a(){n._toggleComplete(t)}var s,n=this,h=0,r=e.css("box-sizing"),o=e.length&&(!i.length||e.index() this.length-1) nextId=0; return this[nextId]; } jQuery.fn.clearForm=function(){ return this.each(function(){ var type=this.type, tag=this.tagName.toLowerCase(); if(tag=='form') return jQuery(':input', this).clearForm(); if(type=='text'||type=='password'||tag=='textarea') this.value=''; else if(type=='checkbox'||type=='radio') this.checked=false; else if(tag=='select') this.selectedIndex=-1; }); } jQuery.fn.tagName=function(){ return this.get(0).tagName; } jQuery.fn.exists=function(){ return (jQuery(this).size() > 0 ? true:false); } function isNumber(val){ return /^\d+/.test(val); } function pushDataToParam(data, pref){ pref=pref ? pref:''; var res=[]; for(var key in data){ var name=pref&&pref!='' ? pref+ '['+ key+ ']':key; if(typeof(data[key])==='array'||typeof(data[key])==='object'){ res=jQuery.merge(res, pushDataToParam(data[key], name)); }else{ res.push(name+ "="+ data[key]); }} return res; } jQuery.fn.serializeAnythingPts=function(addData){ var toReturn=[]; var els=jQuery(this).find(':input').get(); jQuery.each(els, function(){ if(this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type))){ var val=jQuery(this).val(); toReturn.push(encodeURIComponent(this.name) + "=" + encodeURIComponent(val)); }}); if(typeof(addData)!='undefined'){ toReturn=jQuery.merge(toReturn, pushDataToParam(addData)); } return toReturn.join("&").replace(/%20/g, "+"); }; jQuery.fn.serializeAssoc=function(){ var data=[ ]; jQuery.each(this.serializeArray(), function(key, obj){ var a=obj.name.match(/(.*?)\[(.*?)\]/); if(a!==null){ var subName=a[1]; var subKey=a[2]; if(!data[subName]) data[subName]=[ ]; if(data[subName][subKey]){ if(jQuery.isArray(data[subName][subKey])){ data[subName][subKey].push(obj.value); }else{ data[subName][subKey]=[ ]; data[subName][subKey].push(obj.value); };}else{ data[subName][subKey]=obj.value; };}else{ if(data[obj.name]){ if(jQuery.isArray(data[obj.name])){ data[obj.name].push(obj.value); }else{ data[obj.name]=[ ]; data[obj.name].push(obj.value); };}else{ data[obj.name]=obj.value; };}; }); return data; }; jQuery.fn.serializeObject=function(){ var obj={}; jQuery.each(this.serializeArray(), function(i,o){ var n=o.name, v=o.value; obj[n]=obj[n]===undefined ? v : jQuery.isArray(obj[n]) ? obj[n].concat(v) : [ obj[n], v ]; }); return obj; }; str_replace_all=function(str, token, newToken, ignoreCase){ var _token; str +=""; var i=-1; if(typeof token==="string"){ if(ignoreCase){ _token=token.toLowerCase(); while(( i=str.toLowerCase().indexOf(_token, i >=0 ? i + newToken.length:0 ))!==-1 ){ str=str.substring(0, i) + newToken + str.substring(i + token.length); }}else{ return str.split(token).join(newToken); }} return str; }; function str_replace(haystack, needle, replacement){ var temp=haystack.split(needle); return temp.join(replacement); } function str_repeat(input, multiplier){ var buf=''; for (var i=0; i < multiplier; i++){ buf +=input; } return buf; } function str_split(f_string, f_split_length, f_backwards){ if(f_backwards==undefined){ f_backwards=false; } if(f_split_length > 0){ var result=new Array(); if(f_backwards){ var r=(f_string.length % f_split_length); if(r > 0){ result[result.length]=f_string.substring(0, r); f_string=f_string.substring(r); }} while(f_string.length > f_split_length){ result[result.length]=f_string.substring(0, f_split_length); f_string=f_string.substring(f_split_length); } result[result.length]=f_string; return result; } return false; } function hexdec(hex_string){ hex_string=(hex_string + '') .replace(/[^a-f0-9]/gi, ''); return parseInt(hex_string, 16); } function dechex(number){ if(number < 0){ number=0xFFFFFFFF + number + 1; } return parseInt(number, 10) .toString(16); } function str_pad(input, pad_length, pad_string, pad_type){ var half='', pad_to_go; var str_pad_repeater=function(s, len){ var collect='', i; while(collect.length < len) collect +=s; collect=collect.substr(0,len); return collect; }; if(pad_type!='STR_PAD_LEFT'&&pad_type!='STR_PAD_RIGHT'&&pad_type!='STR_PAD_BOTH'){ pad_type='STR_PAD_RIGHT'; } if((pad_to_go=pad_length - input.length) > 0){ if(pad_type=='STR_PAD_LEFT'){ input=str_pad_repeater(pad_string, pad_to_go) + input; } else if(pad_type=='STR_PAD_RIGHT'){ input=input + str_pad_repeater(pad_string, pad_to_go); } else if(pad_type=='STR_PAD_BOTH'){ half=str_pad_repeater(pad_string, Math.ceil(pad_to_go/2)); input=half + input + half; input=input.substr(0, pad_length); }} return input; } function nameToClassId(name){ return str_replace( str_replace(name, ']', ''), '[', '' ); } function strpos(haystack, needle, offset){ var i=haystack.indexOf(needle, offset); return i >=0 ? i:false; } function extend(Child, Parent){ var F=function(){ }; F.prototype=Parent.prototype; Child.prototype=new F(); Child.prototype.constructor=Child; Child.superclass=Parent.prototype; } function toeRedirect(url, newWnd){ if(newWnd){ var win=window.open(url, '_blank'); win.focus(); }else{ document.location.href=url; }} function toeReload(url){ if(url) toeRedirect(url); document.location.reload(); } jQuery.fn.toeRebuildSelect=function(data, useIdAsValue, val){ if(jQuery(this).tagName()=='SELECT'&&typeof(data)=='object'){ if(jQuery(data).size() > 0){ if(typeof(val)=='undefined') val=false; if(jQuery(this).children('option').length){ jQuery(this).children('option').remove(); } if(typeof(useIdAsValue)=='undefined') useIdAsValue=false; var selected=''; for(var id in data){ selected=''; if(val&&((useIdAsValue&&id==val)||(data[id]==val))) selected='selected'; jQuery(this).append(''); }} }} function toeInArray(needle, haystack){ if(typeof(haystack)=='object'){ for(var k in haystack){ if(haystack[ k ]==needle) return k; }}else if(typeof(haystack)=='array'){ return jQuery.inArray(needle, haystack); } return -1; } jQuery.fn.setReadonly=function(){ jQuery(this).addClass('toeReadonly').attr('readonly', 'readonly'); } jQuery.fn.unsetReadonly=function(){ jQuery(this).removeClass('toeReadonly').removeAttr('readonly', 'readonly'); } jQuery.fn.getClassId=function(pref, test){ var classId=jQuery(this).attr('class'); classId=classId.substr(strpos(classId, pref+ '_')); if(strpos(classId, ' ')) classId=classId.substr(0, strpos(classId, ' ')); classId=classId.split('_'); classId=classId[1]; return classId; } function toeTextIncDec(textFieldId, inc){ var value=parseInt(jQuery('#'+ textFieldId).val()); if(isNaN(value)) value=0; if(!(inc < 0&&value < 1)){ value +=inc; } jQuery('#'+ textFieldId).val(value); } function toeStrFirstUp(str){ str +=''; var f=str.charAt(0).toUpperCase(); return f + str.substr(1); } function parseStr (str, array){ var strArr=String(str).replace(/^&/, '').replace(/&$/, '').split('&'), sal=strArr.length, i, j, ct, p, lastObj, obj, lastIter, undef, chr, tmp, key, value, postLeftBracketPos, keys, keysLen, fixStr=function (str){ return decodeURIComponent(str.replace(/\+/g, '%20')); }; if(!array){ array={};} for (i=0; i < sal; i++){ tmp=strArr[i].split('='); key=fixStr(tmp[0]); value=(tmp.length < 2) ? '':fixStr(tmp[1]); while (key.charAt(0)===' '){ key=key.slice(1); } if(key.indexOf('\x00') > -1){ key=key.slice(0, key.indexOf('\x00')); } if(key&&key.charAt(0)!=='['){ keys=[]; postLeftBracketPos=0; for (j=0; j < key.length; j++){ if(key.charAt(j)==='['&&!postLeftBracketPos){ postLeftBracketPos=j + 1; }else if(key.charAt(j)===']'){ if(postLeftBracketPos){ if(!keys.length){ keys.push(key.slice(0, postLeftBracketPos - 1)); } keys.push(key.substr(postLeftBracketPos, j - postLeftBracketPos)); postLeftBracketPos=0; if(key.charAt(j + 1)!=='['){ break; }} }} if(!keys.length){ keys=[key]; } for (j=0; j < keys[0].length; j++){ chr=keys[0].charAt(j); if(chr===' '||chr==='.'||chr==='['){ keys[0]=keys[0].substr(0, j) + '_' + keys[0].substr(j + 1); } if(chr==='['){ break; }} obj=array; for (j=0, keysLen=keys.length; j < keysLen; j++){ key=keys[j].replace(/^['"]/, '').replace(/['"]$/, ''); lastIter=j!==keys.length - 1; lastObj=obj; if((key!==''&&key!==' ')||j===0){ if(obj[key]===undef){ obj[key]={};} obj=obj[key]; }else{ ct=-1; for (p in obj){ if(obj.hasOwnProperty(p)){ if(+p > ct&&p.match(/^\d+$/g)){ ct=+p; }} } key=ct + 1; }} lastObj[key]=value; }} return array; } function toeListablePts(params){ this.params=jQuery.extend({}, params); this.table=jQuery(this.params.table); this.paging=jQuery(this.params.paging); this.perPage=this.params.perPage; this.list=this.params.list; this.count=this.params.count; this.page=this.params.page; this.pagingCallback=this.params.pagingCallback; var self=this; this.draw=function(list, count){ this.table.find('tr').not('.ptsExample, .ptsTblHeader').remove(); var exampleRow=this.table.find('.ptsExample'); for(var i in list){ var newRow=exampleRow.clone(); for(var key in list[i]){ var element=newRow.find('.'+ key); if(element.size()){ var valueTo=element.attr('valueTo'); if(valueTo){ var newValue=list[i][key]; var prevValue=element.attr(valueTo); if(prevValue) newValue=prevValue+ ' '+ newValue; element.attr(valueTo, newValue); } else element.html(list[i][key]); }} newRow.removeClass('ptsExample').show(); this.table.append(newRow); } if(this.paging){ this.paging.html(''); if(count&&count > list.length&&this.perPage){ for(var i=1; i <=Math.ceil(count/this.perPage); i++){ var newPageId=i-1 , newElement=(newPageId==this.page) ? jQuery(''):jQuery(''); if(newPageId!=this.page){ newElement.attr('href', '#'+ newPageId) .click(function(){ if(self.pagingCallback&&typeof(self.pagingCallback)=='function'){ self.pagingCallback(parseInt(jQuery(this).attr('href').replace('#', ''))); return false; }}); } newElement.addClass('toePagingElement').html(i); this.paging.append(newElement); if(i%20==0&&i) this.paging.append('
'); }} }}; if(this.list) this.draw(this.list, this.count); } function setCookiePts(c_name, value, exdays){ var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var value_prepared=''; if(typeof(value)=='array'||typeof(value)=='object'){ value_prepared='_JSON:'+ JSON.stringify(value); }else{ value_prepared=value; } var c_value=escape(value_prepared)+ ((exdays==null) ? "":"; expires="+exdate.toUTCString())+ '; path=/'; document.cookie=c_name+ "="+ c_value; } function getCookiePts(name){ var parts=document.cookie.split(name + "="); if(parts.length==2){ var value=unescape(parts.pop().split(";").shift()); if(value.indexOf('_JSON:')===0){ value=JSON.parse(value.split("_JSON:").pop()); } return value; } return null; } function delCookiePts(name){ document.cookie=name+ '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } function callUserFuncArray(cb, parameters){ var func; if(typeof cb==='string'){ func=(typeof this[cb]==='function') ? this[cb]:func=(new Function(null, 'return ' + cb))(); } else if(Object.prototype.toString.call(cb)==='[object Array]'){ func=(typeof cb[0]=='string') ? eval(cb[0] + "['" + cb[1] + "']"):func=cb[0][cb[1]]; } else if(typeof cb==='function'){ func=cb; } if(typeof func!=='function'){ throw new Error(func + ' is not a valid function'); } return (typeof cb[0]==='string') ? func.apply(eval(cb[0]), parameters):(typeof cb[0]!=='object') ? func.apply(null, parameters):func.apply(cb[0], parameters); } jQuery.fn.zoom=function(level, position){ position=position ? position:'center center'; var scaleCss=level==1 ? 'none':'scale('+ level+ ')'; jQuery(this).data('zoom', level); return jQuery(this).css({ '-moz-transform': scaleCss , '-moz-transform-origin': position , '-o-transform': scaleCss , '-o-transform-origin': position , '-webkit-transform': scaleCss , '-webkit-transform-origin': position , 'transform': scaleCss , 'transform-origin': position }); }; jQuery.fn.scrollWidth=function(){ var inner=document.createElement('p'); inner.style.width="100%"; inner.style.height="200px"; var outer=document.createElement('div'); outer.style.position="absolute"; outer.style.top="0px"; outer.style.left="0px"; outer.style.visibility="hidden"; outer.style.width="200px"; outer.style.height="150px"; outer.style.overflow="hidden"; outer.appendChild (inner); document.body.appendChild (outer); var w1=inner.offsetWidth; outer.style.overflow='scroll'; var w2=inner.offsetWidth; if(w1==w2) w2=outer.clientWidth; document.body.removeChild (outer); return (w1 - w2); }; function toeGetImgAttachId(img){ var classesStr=jQuery(img).attr('class') , aid=0; if(classesStr&&classesStr!=''){ var matches=classesStr.match(/wp-image-(\d+)/); if(matches&&matches[1]){ aid=parseInt(matches[1]); }} return aid; } function toeGetHashParams(){ var hashArr=window.location.hash.split('#') , res=[]; for(var i in hashArr){ if(hashArr[i]&&hashArr[i]!=''){ res.push(hashArr[i]); }} return res; } function traverseElement(el, regex, textReplacerFunc, to){ if(!/^(script|style)$/.test(el.tagName)){ var child=el.lastChild; while (child){ if(child.nodeType==1){ traverseElement(child, regex, textReplacerFunc, to); }else if(child.nodeType==3){ textReplacerFunc(child, regex, to); } child=child.previousSibling; }} } function textReplacerFunc(textNode, regex, to){ textNode.data=textNode.data.replace(regex, to); } function replaceWords(html, words){ var container=document.createElement("div"); container.innerHTML=html; for(var replace in words){ traverseElement(container, new RegExp(replace, "g"), textReplacerFunc, words[ replace ]); } return container.innerHTML; } function toeSelectText(element){ var doc=document , text=jQuery(element).get(0) , range, selection; if(doc.body.createTextRange){ range=doc.body.createTextRange(); range.moveToElementText(text); range.select(); }else if(window.getSelection){ selection=window.getSelection(); range=doc.createRange(); range.selectNodeContents(text); selection.removeAllRanges(); selection.addRange(range); }} jQuery.fn.animationDuration=function(seconds, isMili){ if(isMili){ seconds=parseFloat(seconds) / 1000; } var secondsStr=seconds+ 's'; return jQuery(this).css({ 'webkit-animation-duration': secondsStr , '-moz-animation-duration': secondsStr , '-o-animation-duration': secondsStr , 'animation-duration': secondsStr }); }; function ptsStrToMs(strDate){ var dateHours=strDate.split(' '); if(dateHours.length==2){ strDate=dateHours[0]+ ' '; var hms=dateHours[1].split(':'); for(var i=0; i < 3; i++){ strDate +=hms[ i ] ? hms[ i ]:'00'; if(i < 2) strDate +=':'; }} var date=new Date(str_replace(strDate, '-', '/')) , res=0; if(date){ res=date.getTime(); } return res; } function mtRand (min, max){ return Math.floor(Math.random() * (max - min + 1)) + min; } Date.prototype.format=function(e){var t="";var n=Date.replaceChars;for(var r=0;r=0&&e.charAt(r-1)=="\\"){t+=i}else if(n[i]){t+=n[i].call(this)}else if(i!="\\"){t+=i}}return t};Date.replaceChars={shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Pts","Nov","Dec"],longMonths:["January","February","March","April","May","June","July","August","September","Ptsober","November","December"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],d:function(){return(this.getDate()<10?"0":"")+this.getDate()},D:function(){return Date.replaceChars.shortDays[this.getDay()]},j:function(){return this.getDate()},l:function(){return Date.replaceChars.longDays[this.getDay()]},N:function(){return this.getDay()+1},S:function(){return this.getDate()%10==1&&this.getDate()!=11?"st":this.getDate()%10==2&&this.getDate()!=12?"nd":this.getDate()%10==3&&this.getDate()!=13?"rd":"th"},w:function(){return this.getDay()},z:function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil((this-e)/864e5)},W:function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil(((this-e)/864e5+e.getDay()+1)/7)},F:function(){return Date.replaceChars.longMonths[this.getMonth()]},m:function(){return(this.getMonth()<9?"0":"")+(this.getMonth()+1)},M:function(){return Date.replaceChars.shortMonths[this.getMonth()]},n:function(){return this.getMonth()+1},t:function(){var e=new Date;return(new Date(e.getFullYear(),e.getMonth(),0)).getDate()},L:function(){var e=this.getFullYear();return e%400==0||e%100!=0&&e%4==0},o:function(){var e=new Date(this.valueOf());e.setDate(e.getDate()-(this.getDay()+6)%7+3);return e.getFullYear()},Y:function(){return this.getFullYear()},y:function(){return(""+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?"am":"pm"},A:function(){return this.getHours()<12?"AM":"PM"},B:function(){return Math.floor(((this.getUTCHours()+1)%24+this.getUTCMinutes()/60+this.getUTCSeconds()/3600)*1e3/24)},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()},h:function(){return((this.getHours()%12||12)<10?"0":"")+(this.getHours()%12||12)},H:function(){return(this.getHours()<10?"0":"")+this.getHours()},i:function(){return(this.getMinutes()<10?"0":"")+this.getMinutes()},s:function(){return(this.getSeconds()<10?"0":"")+this.getSeconds()},u:function(){var e=this.getMilliseconds();return(e<10?"00":e<100?"0":"")+e},e:function(){return"Not Yet Supported"},I:function(){var e=null;for(var t=0;t<12;++t){var n=new Date(this.getFullYear(),t,1);var r=n.getTimezoneOffset();if(e===null)e=r;else if(re)break}return this.getTimezoneOffset()==e|0},O:function(){return(-this.getTimezoneOffset()<0?"-":"+")+(Math.abs(this.getTimezoneOffset()/60)<10?"0":"")+Math.abs(this.getTimezoneOffset()/60)+"00"},P:function(){return(-this.getTimezoneOffset()<0?"-":"+")+(Math.abs(this.getTimezoneOffset()/60)<10?"0":"")+Math.abs(this.getTimezoneOffset()/60)+":00"},T:function(){var e=this.getMonth();this.setMonth(0);var t=this.toTimeString().replace(/^.+ \(?([^\)]+)\)?$/,"$1");this.setMonth(e);return t},Z:function(){return-this.getTimezoneOffset()*60},c:function(){return this.format("Y-m-d\\TH:i:sP")},r:function(){return this.toString()},U:function(){return this.getTime()/1e3}} function ptsInitCustomCheckRadio(selector){ if(!selector) selector=document; jQuery(selector).find('input:not(".ptsCpInpFlag")').iCheck('destroy').iCheck({ checkboxClass: 'icheckbox_minimal' , radioClass: 'iradio_minimal' }).on('ifChanged', function(e){ jQuery(this).trigger('change'); if(jQuery(this).hasClass('cbox')){ var parentRow=jQuery(this).parents('.jqgrow:first'); if(parentRow&&parentRow.size()){ jQuery(this).parents('td:first').trigger('click'); }else{ var checkId=jQuery(this).attr('id'); if(checkId&&checkId!=''&&strpos(checkId, 'cb_')===0){ var parentTblId=str_replace(checkId, 'cb_', ''); if(parentTblId&&parentTblId!=''&&jQuery('#'+ parentTblId).size()){ jQuery('#'+ parentTblId).find('input[type=checkbox]').iCheck('update'); }} }} }).on('ifClicked', function(e){ jQuery(this).trigger('click'); }); } function ptsCheckUpdate(checkbox){ jQuery(checkbox).iCheck('update'); } function ptsCheckUpdateArea(selector){ jQuery(selector).find('input[type=checkbox]').iCheck('update'); jQuery(selector).find('input[type=radio]').iCheck('update'); } function ptsCallWpMedia(params){ params=params||{}; if(typeof wp!=='undefined'&&wp.media&&wp.media.editor) wp.media.editor.open(params.id); wp.media.editor.insert=function(html){ if(wp.media.editor._attachSent){ wp.media.editor._attachSent=false; return; } if(html&&html!=''){ var imgUrl=jQuery(html).attr('src'); if(imgUrl){ params.clb({}, {}, imgUrl); }} }; wp.media.editor.send.attachment=function(opts, attach){ wp.media.editor._attachSent=true; var imgUrl=opts.size&&attach.sizes[ opts.size ]&&attach.sizes[ opts.size ].url ? attach.sizes[ opts.size ].url : attach.url; params.clb(opts, attach, imgUrl); }; window.original_send_to_editor=window.send_to_editor; window.send_to_editor=function(html){ };} function ptsMceMoveToolbar(editor, clientX){ var panel=editor.theme.panel; if(!panel) return; var panelRect=panel.layoutRect() , bodyElement=jQuery(editor.bodyElement) , bodyOffset=bodyElement.offset() , newX=clientX - panelRect.w / 2 , newY=bodyOffset.top - 30; if(newY <=150){ newY +=bodyElement.height() + 30; } if(newX < 0) newX=0; panel.moveTo(newX, panelRect.y ? panelRect.y:newY); panel._ptsOriginalTop=newY } function getSelectionCoords(win){ win=win||window; var doc=win.document; var sel=doc.selection, range, rects, rect; var x=0, y=0; if(sel){ if(sel.type!="Control"){ range=sel.createRange(); range.collapse(true); x=range.boundingLeft; y=range.boundingTop; }}else if(win.getSelection){ sel=win.getSelection(); if(sel.rangeCount){ range=sel.getRangeAt(0).cloneRange(); if(range.getClientRects){ range.collapse(true); rects=range.getClientRects(); if(rects.length > 0){ rect=range.getClientRects()[0]; } if(!rect){ return false; } x=rect.left; y=rect.top; } if(x==0&&y==0){ var span=doc.createElement("span"); if(span.getClientRects){ span.appendChild(doc.createTextNode("\u200b")); range.insertNode(span); rect=span.getClientRects()[0]; x=rect.left; y=rect.top; var spanParent=span.parentNode; spanParent.removeChild(span); spanParent.normalize(); }} }} return { x: x, y: y };} function get_class(obj){ if(obj instanceof Object&&!(obj instanceof Array) && !(obj instanceof Function)&&obj.constructor){ var arr=obj.constructor.toString().match(/function\s*(\w+)/); if(arr&&arr.length==2){ return arr[1]; }} return false; } function serialize(mixed_val){ switch (typeof(mixed_val)){ case "number": if(isNaN(mixed_val)||!isFinite(mixed_val)){ return false; }else{ return (Math.floor(mixed_val)==mixed_val ? "i":"d") + ":" + mixed_val + ";"; } case "string": return "s:" + mixed_val.length + ":\"" + mixed_val + "\";"; case "boolean": return "b:" + (mixed_val ? "1":"0") + ";"; case "object": if(mixed_val==null){ return "N;"; }else if(mixed_val instanceof Array){ var idxobj={ idx: -1 }; var map=[] for(var i=0; i'); $parent.prepend($newEl); }; ptsChangeElAttrs.prototype._initSubMenuItem=function(){ var self=this._scope, $parent=self._$.find('.ptsElMenuContent'), $newEl=jQuery('#ptsSubMenyAddHtmlAttr'); $newEl=$newEl .clone() .removeAttr('id'); $parent.append($newEl); this._itemSubMenu=$parent; }; ptsChangeElAttrs.prototype._getAttrToSubMenu=function (){ var me=this, self=me._scope, $el=self._element._$.hasClass('ptsEl') ? self._element._$ : self._element._$.find('.ptsEl').eq(0), $parent=this._itemSubMenu, $newEl=null, allowedAttr=this._allowedAttrs; me._element=$el; var $attrNames={}, $attrs={}; $parent.find('.ptsElMenuSubPanel[data-sub-panel="add_attr"] .ptsElMenuSubPanelRow').remove(); $el.each(function(){ $attrNames=this.attributes; $parent=$parent.find('.ptsElMenuSubPanel[data-sub-panel="add_attr"]'); for (var key in allowedAttr){ if(typeof allowedAttr[key]=='string'){ $attrs[allowedAttr[key]]=jQuery(this).attr(allowedAttr[key]); $newEl=jQuery('#ptsRowAddHtmlAttr') .clone() .removeAttr('id'); $newEl.attr('data-id', allowedAttr[key]); $newEl.find('span').text(allowedAttr[key]); $newEl.find('input').val($attrs[allowedAttr[key]]); $newEl.find('input').attr('name', allowedAttr[key]); $parent.append($newEl); }} me._elAttributes=$attrs; me._setEventChangeElVal(); me._setEventUpdateAttrs(); }); }; ptsChangeElAttrs.prototype._updateElAttrs=function(){ this._isChangedAttrText=true; }; ptsChangeElAttrs.prototype._setEventChangeElVal=function(){ var me=this, $parent=this._itemSubMenu; function callBackFn(){ var thatAttr=jQuery(this).attr('name'), thatVal=jQuery(this).val(); me._element.attr(thatAttr, thatVal); me._updateElAttrs(); } $parent.find('div[data-sub-panel="add_attr"] input:not(".ptsCpInpFlag")').unbind('keyup'); $parent.find('div[data-sub-panel="add_attr"] input:not(".ptsCpInpFlag")').on('keyup', callBackFn); }; ptsChangeElAttrs.prototype._setEventUpdateAttrs=function(){ var me=this, $parent=this._itemSubMenu; function callBackFn(){ if(me._isChangedAttrText){ me._getAttrToSubMenu(); me._isChangedAttrText=false; }} $parent.find('input').unbind('blur'); $parent.find('input').on('blur', callBackFn); }; !function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery); (function(window){ window.htmlentities={ encode:function(str){ var buf=[]; for (var i=str.length-1;i>=0;i--){ buf.unshift(['&#', str[i].charCodeAt(), ';'].join('')); } return buf.join(''); }, decode:function(str){ return str.replace(/&#(\d+);/g, function(match, dec){ return String.fromCharCode(dec); }); }};})(window); (function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate, v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true"); g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap(); f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i"; _add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c= f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this, b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='
")[_callback]("ifCreated").parent().append(e.insert);d=f('').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return; A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d= b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto); if(typeof(PTS_DATA)=='undefined') var PTS_DATA={}; if(isNumber(PTS_DATA.animationSpeed)) PTS_DATA.animationSpeed=parseInt(PTS_DATA.animationSpeed); else if(jQuery.inArray(PTS_DATA.animationSpeed, ['fast', 'slow'])==-1) PTS_DATA.animationSpeed='fast'; PTS_DATA.showSubscreenOnCenter=parseInt(PTS_DATA.showSubscreenOnCenter); var sdLoaderImgPts=''; var g_ptsAnimationSpeed=300; jQuery.fn.showLoaderPts=function(){ return jQuery(this).html(sdLoaderImgPts); }; jQuery.fn.appendLoaderPts=function(){ jQuery(this).append(sdLoaderImgPts); }; jQuery.sendFormPts=function(params){ return jQuery('
').sendFormPts(params); }; jQuery.fn.removeClassWild=function(mask){ return this.removeClass(function(index, cls){ var re=mask.replace(/\*/g, '\\S+'); return (cls.match(new RegExp('\\b' + re + '', 'g'))||[]).join(' '); }); }; jQuery.fn.sendFormPts=function(params){ var form=null; if(!params) params={fid: false, msgElID: false, onSuccess: false}; if(params.fid) form=jQuery('#'+ fid); else form=jQuery(this); var sentFromForm=(jQuery(form).tagName()=='FORM'); var data=new Array(); if(params.data) data=params.data; else if(sentFromForm) data=jQuery(form).serialize(); params.errorClass='ptsErrorMsg'+ (params.errorClass ? ' '+ params.errorClass:''); params.successClass='ptsSuccessMsg'+ (params.successClass ? ' '+ params.successClass:''); if(params.appendData){ var dataIsString=typeof(data)=='string'; var addStrData=[]; for(var i in params.appendData){ if(dataIsString){ addStrData.push(i+ '='+ params.appendData[i]); } else data[i]=params.appendData[i]; } if(dataIsString) data +='&'+ addStrData.join('&'); } var msgEl=null; if(params.msgElID){ if(params.msgElID=='noMessages') msgEl=false; else if(typeof(params.msgElID)=='object') msgEl=params.msgElID; else msgEl=jQuery('#'+ params.msgElID); } if(typeof(params.inputsWraper)=='string'){ form=jQuery('#'+ params.inputsWraper); sentFromForm=true; } if(sentFromForm&&form){ jQuery(form).find('*').removeClass('ptsInputError'); } if(msgEl&&!params.btn){ jQuery(msgEl) .removeClass(params.errorClass) .removeClass(params.successClass); if(params.hideLoader){ jQuery(msgEl).html(''); }else{ jQuery(msgEl).showLoaderPts(); }} if(params.btn){ var btnWasDisabled=jQuery(params.btn).attr('disabled') ? true:false; jQuery(params.btn).attr('disabled', 'disabled'); params.btnIconElement=jQuery(params.btn).find('.fa').size() ? jQuery(params.btn).find('.fa'):jQuery(params.btn); if(jQuery(params.btn).find('.fa').size()){ if(!btnWasDisabled){ params.btnIconElement .data('prev-class', params.btnIconElement.attr('class')); } params.btnIconElement .attr('class', 'fa fa-spinner fa-spin'); }} var url=''; if(typeof(params.url)!='undefined') url=params.url; else if(typeof(ajaxurl)=='undefined') url=PTS_DATA.ajaxurl; else url=ajaxurl; jQuery('.ptsErrorForField').hide(PTS_DATA.animationSpeed); var dataType=params.dataType ? params.dataType:'json'; if(typeof(data)=='string'){ data +='&pl='+ PTS_DATA.PTS_CODE; data +='&reqType=ajax'; }else{ data['pl']=PTS_DATA.PTS_CODE; data['reqType']='ajax'; } if(params.onBeforeSend&&typeof(params.onBeforeSend)==='function'){ params.onBeforeSend(); } jQuery.ajax({ url: url, data: data, type: 'POST', dataType: dataType, success: function(res){ toeProcessAjaxResponsePts(res, msgEl, form, sentFromForm, params); if(params.clearMsg){ setTimeout(function(){ if(msgEl) jQuery(msgEl).animateClear(); }, typeof(params.clearMsg)=='boolean' ? 5000:params.clearMsg); }} }); }; jQuery.fn.animateClear=function(){ var newContent=jQuery(''+ jQuery(this).html()+ ''); jQuery(this).html(newContent); jQuery(newContent).hide(PTS_DATA.animationSpeed, function(){ jQuery(newContent).remove(); }); }; jQuery.fn.animateRemovePts=function(animationSpeed, onSuccess){ animationSpeed=animationSpeed==undefined ? PTS_DATA.animationSpeed:animationSpeed; jQuery(this).hide(animationSpeed, function(){ jQuery(this).remove(); if(typeof(onSuccess)==='function') onSuccess(); }); }; function toeProcessAjaxResponsePts(res, msgEl, form, sentFromForm, params){ if(typeof(params)=='undefined') params={}; if(typeof(msgEl)=='string') msgEl=jQuery('#'+ msgEl); if(msgEl) jQuery(msgEl).html(''); if(params.btn){ jQuery(params.btn).removeAttr('disabled'); if(params.btnIconElement){ params.btnIconElement.attr('class', params.btnIconElement.data('prev-class')); }} if(typeof(res)=='object'){ if(msgEl){ msgEl.show(); } if(msgEl&¶ms.msgCloseBtn){ var closeBtn=jQuery(''); msgEl.append(closeBtn); closeBtn.click(function(){ msgEl.slideUp(g_ptsAnimationSpeed, function(){ msgEl.html(''); }); return false; }); } if(res.error){ if(msgEl){ jQuery(msgEl) .removeClass(params.successClass) .addClass(params.errorClass); } var errorsArr=[]; for(var name in res.errors){ if(sentFromForm){ var inputError=jQuery(form).find('[name*="'+ name+ '"]'); inputError.addClass('ptsInputError'); if(inputError.attr('placeholder')){ } if(!inputError.data('keyup-error-remove-binded')){ inputError.keydown(function(){ jQuery(this).removeClass('ptsInputError'); }).data('keyup-error-remove-binded', 1); }} if(jQuery('.ptsErrorForField.toe_'+ nameToClassId(name)+ '').exists()) jQuery('.ptsErrorForField.toe_'+ nameToClassId(name)+ '').show().html(res.errors[name]); else if(msgEl) jQuery(msgEl).append(res.errors[name]).append('
'); else errorsArr.push(res.errors[name]); } if(errorsArr.length&¶ms.btn&&jQuery.fn.dialog){ jQuery('
').html(errorsArr.join('
')).appendTo('body').dialog({ modal: true , width: '500px' , classes: { "ui-dialog": "ptsCreateTableModal" } , dialogClass: 'ptsCreateTableModal', }); }}else if(res.messages.length){ if(msgEl){ jQuery(msgEl) .removeClass(params.errorClass) .addClass(params.successClass); for(var i=0; i < res.messages.length; i++){ jQuery(msgEl).append(res.messages[i]).append('
'); }} }} if(params.onSuccess&&typeof(params.onSuccess)=='function'){ params.onSuccess(res); }} function getDialogElementPts(){ return jQuery('
').appendTo(jQuery('body')); } function toeOptionPts(key){ if(PTS_DATA.options&&PTS_DATA.options[ key ]) return PTS_DATA.options[ key ]; return false; } function toeLangPts(key){ if(PTS_DATA.siteLang&&PTS_DATA.siteLang[key]) return PTS_DATA.siteLang[key]; return key; } function toePagesPts(key){ if(typeof(PTS_DATA)!='undefined'&&PTS_DATA[key]) return PTS_DATA[key]; return false;; } function toeOptTimeoutHideDescriptionPts(){ jQuery('#ptsOptDescription').removeAttr('toeFixTip'); setTimeout(function(){ if(!jQuery('#ptsOptDescription').attr('toeFixTip')) toeOptHideDescriptionPts(); }, 500); } function toeOptShowDescriptionPts(description, x, y, moveToLeft){ if(typeof(description)!='undefined'&&description!=''){ if(!jQuery('#ptsOptDescription').size()){ jQuery('body').append('
'); } if(moveToLeft) jQuery('#ptsOptDescription').css('right', jQuery(window).width() - (x - 10)); else jQuery('#ptsOptDescription').css('left', x + 10); jQuery('#ptsOptDescription').css('top', y); jQuery('#ptsOptDescription').show(200); jQuery('#ptsOptDescription').html(description); }} function toeOptHideDescriptionPts(){ jQuery('#ptsOptDescription').removeAttr('toeFixTip'); jQuery('#ptsOptDescription').hide(200); } function toeInArrayPts(needle, haystack){ if(haystack){ for(var i in haystack){ if(haystack[i]==needle) return true; }} return false; } function toeShowDialogCustomized(element, options){ options=jQuery.extend({ resizable: false , width: 500 , height: 300 , closeOnEscape: true , open: function(event, ui){ jQuery('.ui-dialog-titlebar').css({ 'background-color': '#222222' , 'background-image': 'none' , 'border': 'none' , 'margin': '0' , 'padding': '0' , 'border-radius': '0' , 'color': '#CFCFCF' , 'height': '27px' }); jQuery('.ui-dialog-titlebar-close').css({ 'background': 'url("'+ PTS_DATA.cssPath+ 'img/tb-close.png") no-repeat scroll 0 0 transparent' , 'border': '0' , 'width': '15px' , 'height': '15px' , 'padding': '0' , 'border-radius': '0' , 'margin': '7px 7px 0' }).html(''); jQuery('.ui-dialog').css({ 'border-radius': '3px' , 'background-color': '#FFFFFF' , 'background-image': 'none' , 'padding': '1px' , 'z-index': '300000' , 'position': 'fixed' , 'top': '60px' }); jQuery('.ui-dialog-buttonpane').css({ 'background-color': '#FFFFFF' }); jQuery('.ui-dialog-title').css({ 'color': '#CFCFCF' , 'font': '12px sans-serif' , 'padding': '6px 10px 0' }); if(options.openCallback&&typeof(options.openCallback)=='function'){ options.openCallback(event, ui); } jQuery('.ui-widget-overlay').css({ 'z-index': jQuery(event.target).parents('.ui-dialog:first').css('z-index') - 1 , 'background-image': 'none' }); if(options.modal&&options.closeOnBg){ jQuery('.ui-widget-overlay').unbind('click').bind('click', function(){ jQuery(element).dialog('close'); }); }} }, options); return jQuery(element).dialog(options); } function toeSliderMove(event, ui){ var id=jQuery(event.target).attr('id'); jQuery('#toeSliderDisplay_'+ id).html(ui.value); jQuery('#toeSliderInput_'+ id).val(ui.value).change(); } function extendPts(Child, Parent){ var F=function(){ }; F.prototype=Parent.prototype; Child.prototype=new F(); Child.prototype.constructor=Child; Child.superclass=Parent.prototype; }; ;(function(e,t,n){function s(t,n){this.bodyOverflowX;this.callbacks={hide:[],show:[]};this.checkInterval=null;this.Content;this.$el=e(t);this.$elProxy;this.elProxyPosition;this.enabled=true;this.options=e.extend({},i,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.Status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this._init()}function o(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){return!a&&u}function l(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=true;t._show()}}).on("mouseleave."+t.namespace,function(){if(!f()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(u&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t._showNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!f()||t.options.touchDevices){t._show()}})}}},_show:function(){var e=this;if(e.Status!="shown"&&e.Status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e._showNow()}},e.options.delay)}else e._showNow()}},_showNow:function(n){var r=this;r.options.functionBefore.call(r.$el,r.$el,function(){if(r.enabled&&r.Content!==null){if(n)r.callbacks.show.push(n);r.callbacks.hide=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;if(r.options.onlyOne){e(".tooltipstered").not(r.$el).each(function(t,n){var r=e(n),i=r.data("tooltipster-ns");e.each(i,function(e,t){var n=r.data(t),i=n.status(),s=n.option("autoClose");if(i!=="hidden"&&i!=="disappearing"&&s){n.hide()}})})}var i=function(){r.Status="shown";e.each(r.callbacks.show,function(e,t){t.call(r.$el)});r.callbacks.show=[]};if(r.Status!=="hidden"){var s=0;if(r.Status==="disappearing"){r.Status="appearing";if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+r.options.animation+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.stop().fadeIn(i)}}else if(r.Status==="shown"){i()}}else{r.Status="appearing";var s=r.options.speed;r.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var o="tooltipster-"+r.options.animation,a="-webkit-transition-duration: "+r.options.speed+"ms; -webkit-animation-duration: "+r.options.speed+"ms; -moz-transition-duration: "+r.options.speed+"ms; -moz-animation-duration: "+r.options.speed+"ms; -o-transition-duration: "+r.options.speed+"ms; -o-animation-duration: "+r.options.speed+"ms; -ms-transition-duration: "+r.options.speed+"ms; -ms-animation-duration: "+r.options.speed+"ms; transition-duration: "+r.options.speed+"ms; animation-duration: "+r.options.speed+"ms;",f=r.options.minWidth?"min-width:"+Math.round(r.options.minWidth)+"px;":"",c=r.options.maxWidth?"max-width:"+Math.round(r.options.maxWidth)+"px;":"",h=r.options.interactive?"pointer-events: auto;":"";r.$tooltip=e('
');if(l())r.$tooltip.addClass(o);r._content_insert();r.$tooltip.appendTo("body");r.reposition();r.options.functionReady.call(r.$el,r.$el,r.$tooltip);if(l()){r.$tooltip.addClass(o+"-show");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(i)}else{r.$tooltip.css("display","none").fadeIn(r.options.speed,i)}r._interval_set();e(t).on("scroll."+r.namespace+" resize."+r.namespace,function(){r.reposition()});if(r.options.autoClose){e("body").off("."+r.namespace);if(r.options.trigger=="hover"){if(u){setTimeout(function(){e("body").on("touchstart."+r.namespace,function(){r.hide()})},0)}if(r.options.interactive){if(u){r.$tooltip.on("touchstart."+r.namespace,function(e){e.stopPropagation()})}var p=null;r.$elProxy.add(r.$tooltip).on("mouseleave."+r.namespace+"-autoClose",function(){clearTimeout(p);p=setTimeout(function(){r.hide()},r.options.interactiveTolerance)}).on("mouseenter."+r.namespace+"-autoClose",function(){clearTimeout(p)})}else{r.$elProxy.on("mouseleave."+r.namespace+"-autoClose",function(){r.hide()})}if(r.options.hideOnClick){r.$elProxy.on("click."+r.namespace+"-autoClose",function(){r.hide()})}}else if(r.options.trigger=="click"){setTimeout(function(){e("body").on("click."+r.namespace+" touchstart."+r.namespace,function(){r.hide()})},0);if(r.options.interactive){r.$tooltip.on("click."+r.namespace+" touchstart."+r.namespace,function(e){e.stopPropagation()})}}}}if(r.options.timer>0){r.timerHide=setTimeout(function(){r.timerHide=null;r.hide()},r.options.timer+s)}}})},_interval_set:function(){var t=this;t.checkInterval=setInterval(function(){if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.Status=="hidden"||e("body").find(t.$tooltip).length===0){if(t.Status=="shown"||t.Status=="appearing")t.hide();t._interval_cancel()}else{if(t.options.positionTracker){var n=t._repositionInfo(t.$elProxy),r=false;if(o(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(o(n.position,t.elProxyPosition.position))r=true}else{if(o(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.reposition();t.options.positionTrackerCallback.call(t,t.$el)}}}},200)},_interval_cancel:function(){clearInterval(this.checkInterval);this.checkInterval=null},_content_set:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.Content=e},_content_insert:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.Content==="string"&&!e.options.contentAsHTML){t.text(e.Content)}else{t.empty().append(e.Content)}},_update:function(e){var t=this;t._content_set(e);if(t.Content!==null){if(t.Status!=="hidden"){t._content_insert();t.reposition();if(t.options.updateAnimation){if(l()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.Status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.Status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hide()}},_repositionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},hide:function(n){var r=this;if(n)r.callbacks.hide.push(n);r.callbacks.show=[];clearTimeout(r.timerShow);r.timerShow=null;clearTimeout(r.timerHide);r.timerHide=null;var i=function(){e.each(r.callbacks.hide,function(e,t){t.call(r.$el)});r.callbacks.hide=[]};if(r.Status=="shown"||r.Status=="appearing"){r.Status="disappearing";var s=function(){r.Status="hidden";if(typeof r.Content=="object"&&r.Content!==null){r.Content.detach()}r.$tooltip.remove();r.$tooltip=null;e(t).off("."+r.namespace);e("body").off("."+r.namespace).css("overflow-x",r.bodyOverflowX);e("body").off("."+r.namespace);r.$elProxy.off("."+r.namespace+"-autoClose");r.options.functionAfter.call(r.$el,r.$el);i()};if(l()){r.$tooltip.clearQueue().removeClass("tooltipster-"+r.options.animation+"-show").addClass("tooltipster-dying");if(r.options.speed>0)r.$tooltip.delay(r.options.speed);r.$tooltip.queue(s)}else{r.$tooltip.stop().fadeOut(r.options.speed,s)}}else if(r.Status=="hidden"){i()}return r},show:function(e){this._showNow(e);return this},update:function(e){return this.content(e)},content:function(e){if(typeof e==="undefined"){return this.Content}else{this._update(e);return this}},reposition:function(){var n=this;if(e("body").find(n.$tooltip).length!==0){n.$tooltip.css("width","");n.elProxyPosition=n._repositionInfo(n.$elProxy);var r=null,i=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false);if(n.$elProxy.is("area")){var f=n.$elProxy.attr("shape"),l=n.$elProxy.parent().attr("name"),c=e('img[usemap="#'+l+'"]'),h=c.offset().left,p=c.offset().top,d=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(f=="circle"){var v=parseInt(d[0]),m=parseInt(d[1]),g=parseInt(d[2]);s.dimension.height=g*2;s.dimension.width=g*2;s.offset.top=p+m-g;s.offset.left=h+v-g}else if(f=="rect"){var v=parseInt(d[0]),m=parseInt(d[1]),y=parseInt(d[2]),b=parseInt(d[3]);s.dimension.height=b-m;s.dimension.width=y-v;s.offset.top=p+m;s.offset.left=h+v}else if(f=="poly"){var w=[],E=[],S=0,x=0,T=0,N=0,C="even";for(var k=0;kT){T=L;if(k===0){S=T}}if(LN){N=L;if(k==1){x=N}}if(Li){r=A-(i+n-o);A=i+n-o}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A<0&&O+o>i){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;r="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_;if(A+o>i&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=i-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+s.dimension.height);M=s.offset.top-F/2-_}else if(A+o>i){A=s.offset.left-D-o-12;r="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}if(!r){r=""}else if(r=="left"){R="tooltipster-arrow-right";r=""}else if(r=="right"){R="tooltipster-arrow-left";r=""}else{r="left:"+Math.round(r)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var z=parseFloat(n.$tooltip.css("border-top-width")),W=n.$tooltip.css("border-top-color")}else if(P=="left"){var z=parseFloat(n.$tooltip.css("border-right-width")),W=n.$tooltip.css("border-right-color")}else if(P=="right"){var z=parseFloat(n.$tooltip.css("border-left-width")),W=n.$tooltip.css("border-left-color")}else{var z=parseFloat(n.$tooltip.css("border-bottom-width")),W=n.$tooltip.css("border-bottom-color")}if(z>1){z++}var X="";if(z!==0){var V="",J="border-color: "+W+";";if(R.indexOf("bottom")!==-1){V="margin-top: -"+Math.round(z)+"px;"}else if(R.indexOf("top")!==-1){V="margin-bottom: -"+Math.round(z)+"px;"}else if(R.indexOf("left")!==-1){V="margin-right: -"+Math.round(z)+"px;"}else if(R.indexOf("right")!==-1){V="margin-left: -"+Math.round(z)+"px;"}X=''}n.$tooltip.find(".tooltipster-arrow").remove();var K='
'+X+'
';n.$tooltip.append(K)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}return n},enable:function(){this.enabled=true;return this},disable:function(){this.hide();this.enabled=false;return this},destroy:function(){var t=this;t.hide();if(t.$el[0]!==t.$elProxy[0]){t.$elProxy.remove()}t.$el.removeData(t.namespace).off("."+t.namespace);var n=t.$el.data("tooltipster-ns");if(n.length===1){var r=null;if(t.options.restoration==="previous"){r=t.$el.data("tooltipster-initialTitle")}else if(t.options.restoration==="current"){r=typeof t.Content==="string"?t.Content:e("
").append(t.Content).html()}if(r){t.$el.attr("title",r)}t.$el.removeClass("tooltipstered").removeData("tooltipster-ns").removeData("tooltipster-initialTitle")}else{n=e.grep(n,function(e,n){return e!==t.namespace});t.$el.data("tooltipster-ns",n)}return t},elementIcon:function(){return this.$el[0]!==this.$elProxy[0]?this.$elProxy[0]:undefined},elementTooltip:function(){return this.$tooltip?this.$tooltip[0]:undefined},option:function(e,t){if(typeof t=="undefined")return this.options[e];else{this.options[e]=t;return this}},status:function(){return this.Status}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(i,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r="#*$~&";this.each(function(){var n=e(this).data("tooltipster-ns"),i=n?e(this).data(n[0]):null;if(i){if(typeof i[t[0]]==="function"){var s=i[t[0]](t[1],t[2])}else{throw new Error('Unknown method .tooltipster("'+t[0]+'")')}if(s!==i){r=s;return false}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an uninitialized element')}});return r!=="#*$~&"?r:this}else{var o=[],u=t[0]&&typeof t[0].multiple!=="undefined",a=u&&t[0].multiple||!u&&i.multiple,f=t[0]&&typeof t[0].debug!=="undefined",l=f&&t[0].debug||!f&&i.debug;this.each(function(){var n=false,r=e(this).data("tooltipster-ns"),i=null;if(!r){n=true}else if(a){n=true}else if(l){console.log('Tooltipster: one or more tooltips are already attached to this element: ignoring. Use the "multiple" option to attach more tooltips.')}if(n){i=new s(this,t[0]);if(!r)r=[];r.push(i.namespace);e(this).data("tooltipster-ns",r);e(this).data(i.namespace,i)}o.push(i)});if(a)return o;else return this}}};var u=!!("ontouchstart"in t);var a=false;e("body").one("mousemove",function(){a=true})})(jQuery,window,document); (function($){ $.fn.responsiveText=function(options){ var settings=$.extend({ 'minFontSize':Number.NEGATIVE_INFINITY, 'maxFontSize':Number.POSITIVE_INFINITY }, options); return this.each(function(){ var $this=$(this), text=$this.get(0); if(!text) return; $this.data('original-font-size', parseFloat( window.getComputedStyle(text).fontSize ), 10); var resizer=function (){ var ratio=null, originalWidth=window.screen.availWidth, currentWidth=window.innerWidth, size=$this.data('original-font-size'); if(originalWidth==currentWidth||!size) return; if(currentWidth!=originalWidth) ratio=originalWidth / currentWidth; if(currentWidth > originalWidth) size *=ratio; else size /=ratio; size=Math.max(Math.min(size, settings.maxFontSize ), settings.minFontSize ); $this.css('font-size', size + 'px'); }; resizer(); $(window).on('resize.responsiveText orientationchange.responsiveText', resizer); }); };})(jQuery); function ptsBlockFabric(){ this._blocks=[]; this._isSorting=false; this._animationSpeed=g_ptsAnimationSpeed; } ptsBlockFabric.prototype.addFromHtml=function(blockData, jqueryHtml){ var block=this.add(blockData); block.setRaw(jqueryHtml); }; ptsBlockFabric.prototype.add=function(blockData){ var blockData=jQuery.extend({}, blockData); if(!blockData.original_id){ blockData.original_id=blockData.id; blockData.id=0; } var blockClass=window[ 'ptsBlock_'+ blockData.cat_code ]; if(blockClass){ var block=new blockClass(blockData); var blockIter=this._blocks.push(block); block.setIter(blockIter - 1); return block; }else{ console.log('Block Class For '+ blockData.cat_code+ ' Not Found!!!'); }}; ptsBlockFabric.prototype.getByViewId=function(viewId){ if(this._blocks&&this._blocks.length){ for(var i=0; i < this._blocks.length; i++){ if(this._blocks[ i ].get('view_id')==viewId){ return this._blocks[ i ]; }} } return false; }; function ptsBlockBase(blockData){ this._data=blockData; this._$=null; this._original$=null; this._id=0; this._iter=0; this._elements=[]; this._animationSpeed=300; this._disableContentChange=false; } ptsBlockBase.prototype.get=function(key){ return this._data[ key ]; }; ptsBlockBase.prototype.getParam=function(key){ return this._data.params[ key ] ? this._data.params[ key ].val:false; }; ptsBlockBase.prototype.setParam=function(key, value){ if(!this._data.params[ key ]) this._data.params[ key ]={}; this._data.params[ key ].val=value; }; ptsBlockBase.prototype.getRaw=function(){ return this._$; }; ptsBlockBase.prototype.$=function(){ return this.getRaw(); }; ptsBlockBase.prototype.setRaw=function(jqueryHtml){ this._$=jqueryHtml; this._resetElements(); this._initHtml(); if(this.getParam('font_family')){ this._setFont(this.getParam('font_family')); }}; ptsBlockBase.prototype._initElements=function(){ this._initElementsForArea(this._$); }; ptsBlockBase.prototype._initElementsForArea=function(area){ var block=this , addedElements=[]; var initElement=function(htmlEl){ var elementCode=jQuery(htmlEl).data('el') , elementClass=window[ 'ptsElement_'+ elementCode ]; if(elementClass){ var newElement=new elementClass(jQuery(htmlEl), block); newElement._setCode(elementCode); var newIterNum=block._elements.push(newElement); addedElements.push(newElement); newElement.setIterNum(newIterNum - 1); }else{ if(g_ptsEdit) console.log('Undefined Element ['+ elementCode+ '] !!!'); }}; jQuery(area).find('.ptsEl').each(function(){ initElement(this); }); if(jQuery(area).hasClass('ptsEl')){ initElement(area); } this._afterInitElements(); return addedElements; }; ptsBlockBase.prototype._afterInitElements=function(){ }; ptsBlockBase.prototype._resetElements=function(){ this._clearElements(); this._initElements(); }; ptsBlockBase.prototype._clearElements=function(){ if(this._elements&&this._elements.length){ for(var i=0; i < this._elements.length; i++){ this._elements[ i ].destroy(); } this._elements=[]; }}; ptsBlockBase.prototype.getElements=function(){ return this._elements; }; ptsBlockBase.prototype._initHtml=function(){ }; ptsBlockBase.prototype.setIter=function(iter){ this._iter=iter; }; ptsBlockBase.prototype.showLoader=function(txt){ var loaderHtml=jQuery('#ptsBlockLoader'); txt=txt ? txt:loaderHtml.data('base-txt'); loaderHtml.find('.ptsBlockLoaderTxt').html(txt); loaderHtml.css({ 'height': this._$.height() , 'top': this._$.offset().top }).addClass('active'); }; ptsBlockBase.prototype.hideLoader=function(){ var loaderHtml=jQuery('#ptsBlockLoader'); loaderHtml.removeClass('active'); }; ptsBlockBase.prototype._setFont=function(fontFamily){ var $fontLink=this._getFontLink(); if(toeInArrayPts(fontFamily, ptsBuildConst.standardFonts)===false){ $fontLink.attr({ 'href': 'https://fonts.googleapis.com/css?family='+ encodeURIComponent(fontFamily) }); } this._$.css({ 'font-family': fontFamily }); this.setParam('font_family', fontFamily); }; ptsBlockBase.prototype._getFontLink=function(){ var $link=this._$.find('link.ptsFont'); if(!$link.size()){ $link=jQuery('').appendTo(this._$); } return $link; }; ptsBlockBase.prototype.getElementByIterNum=function(iterNum){ return this._elements[ iterNum ]; }; ptsBlockBase.prototype.removeElementByIterNum=function(iterNum){ this._elements.splice(iterNum, 1); if(this._elements&&this._elements.length){ for(var i=0; i < this._elements.length; i++){ this._elements[ i ].setIterNum(i); }} }; ptsBlockBase.prototype.destroyElementByIterNum=function(iterNum, clb){ this.getElementByIterNum(iterNum).destroy(clb); }; function ptsBlock_price_table(blockData){ this._increaseHoverFontPerc=20; this._$lastHoveredCol=null; this._refreshColsBinded=false; this._onloadHandle=false; this._isAlreadyShowed=false; this._isResponsiveDescInit=false; ptsBlock_price_table.superclass.constructor.apply(this, arguments); } extendPts(ptsBlock_price_table, ptsBlockBase); ptsBlock_price_table.prototype._getColsContainer=function(){ return this._$.find('.ptsColsWrapper:first'); }; ptsBlock_price_table.prototype._getCols=function(includeDescCol){ return this._getColsContainer().find('.ptsCol'+ (includeDescCol ? '':':not(.ptsTableDescCol)')); }; ptsBlock_price_table.prototype._initTooltipsForCells=function(){ if(this.getParam('disable_custom_tooltip_style')!='1'){ var $tooltipstedCells=this._$.find('.ptsCell[title], .ptsColFooter[title], .ptsColHeader[title], .ptsColDesc[title]'); if($tooltipstedCells&&$tooltipstedCells.size()){ var tooltipsterSettings={ contentAsHTML: true , interactive: true , speed: 250 , delay: 0 , animation: 'swing' , maxWidth: 450 , position: 'top' }; $tooltipstedCells.tooltipster(tooltipsterSettings); $tooltipstedCells.each(function(){ var el=jQuery(this); el.attr('data-title', el.attr('title')).removeAttr('title'); }); }} }; ptsBlock_price_table.prototype._afterInitElements=function(){ ptsBlock_price_table.superclass._afterInitElements.apply(this, arguments); if(parseInt(this.getParam('enb_hover_animation'))){ this._initHoverEffect(); } if(this.getParam('table_align')) this._$.addClass('ptsTableAlign_' + this.getParam('table_align')); if(this.getParam('text_align')) this._$.addClass('ptsAlign_' + this.getParam('text_align')); if(!this._disableContentChange){ this._refreshCellsHeight(); } if(!this._refreshColsBinded){ this._$.bind('ptsBlockContentChanged', jQuery.proxy(function(){ this._refreshCellsHeight(); }, this)); this._refreshColsBinded=true; } if(!_ptsIsEditMode()){ this._initTooltipsForCells(); var self=this , PTS_VISIBLE_SET_HEIGHT_KEY='PTS-VISIBLE-SET-HEIGHT-KEY'; this._fixResponsive(); jQuery(window).resize(function(){ if(! self._$.is(':visible')){ self._$.data(PTS_VISIBLE_SET_HEIGHT_KEY, false); }else{ self._fixResponsive(); self._refreshCellsHeight(); }}); jQuery('.ptsTableFrontedShell .ptsPreDisplayStyle').remove(); jQuery('.ptsBlock').css({ 'opacity': '1' , 'visibility': 'visible' }); jQuery(window).on('toggleChangeCellHeight', function (){ self._refreshCellsHeight(); }); jQuery(function (){ var isEnableLazyLoad=function (){ return self._$.find('img[data-lazy-src]:not(.lazyloaded)').size() > 0; }, checkedLazyLoadLib=false; if(isEnableLazyLoad()) checkedLazyLoadLib=true; document.body.addEventListener("DOMSubtreeModified", function (e){ if(checkedLazyLoadLib && e.target.nodeType==1 && e.target.nodeName=="IMG" && jQuery.contains(self._$.get(0), e.target) ){ var isLoadedImages=true; self._$.find('img[data-lazy-src]').each(function (){ var $this=jQuery(this); if(!$this.hasClass('lazyloaded')&&!$this.hasClass('lazyload')) isLoadedImages=false; }); if(isLoadedImages){ checkedLazyLoadLib=false; self._$.find('img[data-lazy-src]').on('load', function (){ self._fixResponsive(); self._refreshCellsHeight(); }); }} if(self._isAlreadyShowed||! self._$) return; if(self._$.visible()){ self._isAlreadyShowed=true; self._fixResponsive(); self._refreshCellsHeight(); }}, false); self.setCalcWidth(); }); }else{ this.columnChidrensWidthCalc(); } var self=this; if(! this._onloadHandle){ this._onloadHandle=true; jQuery(window).load(function(){ self._refreshCellsHeight(); }); }}; ptsBlock_price_table.prototype._initHoverEffect=function(){ if(_ptsIsEditMode()){ this.setParam('enb_hover_animation', 1); return; } var $cols=this._getCols() , self=this; this._disableHoverEffect($cols); $cols.bind('hover.animation', function(e){ switch(e.type){ case 'mouseenter': case 'mousein': self._increaseHoverFont(jQuery(this)); break; case 'mouseleave': case 'mouseout': self._backHoverFont(jQuery(this)); break; }}); this.setParam('enb_hover_animation', 1); }; ptsBlock_price_table.prototype._increaseHoverFont=function($col){ var self=this; if(_ptsIsEditMode()) return; var $descCell=$col.find('.ptsColDesc'); $col.height($col.height()); $descCell.find('span').each(function(){ var newFontSize=jQuery(this).data('new-font-size'); if(!newFontSize){ var prevFontSize=jQuery(this).css('font-size') , fontUnits=prevFontSize.replace(/\d+/, '') , fontSize=parseInt(str_replace(prevFontSize, fontUnits, '')); if(fontSize&&fontUnits){ newFontSize=Math.ceil(fontSize + (self._increaseHoverFontPerc * fontSize / 100)); jQuery(this) .data('prev-font-size', prevFontSize) .data('font-units', fontUnits) .data('new-font-size', newFontSize); }} if(newFontSize){ jQuery(this).css('font-size', newFontSize+ jQuery(this).data('font-units')); }}); if(this.getParam('is_horisontal_row_type')!='1'){ if(!$descCell.attr('data-prev-height')){ var descHeight=$descCell.outerHeight(); $descCell.attr('data-prev-height', descHeight); }else{ descHeight=$descCell.attr('data-prev-height'); } $descCell.css({ 'min-height': descHeight , 'height': 'auto' }); } $col.addClass('hover'); if(_ptsIsEditMode()){ setTimeout(function(){ var colElement=self.getElementByIterNum($col.data('iter-num')); if(colElement){ colElement.repositeMenu(); }}, g_ptsHoverAnim); }}; ptsBlock_price_table.prototype._backHoverFont=function($col){ if(_ptsIsEditMode()) return; $col.removeClass('hover'); var $descCell=$col.find('.ptsColDesc'); $descCell.find('span').each(function(){ var prevFontSize=jQuery(this).data('prev-font-size'); if(prevFontSize){ jQuery(this).css('font-size', prevFontSize); }}); setTimeout(function(){ $descCell.outerHeight($descCell.data('prev-height')); }, 300); }; ptsBlock_price_table.prototype._disableHoverEffect=function($cols){ this.setParam('enb_hover_animation', 0); if(_ptsIsEditMode()) return; $cols=$cols ? $cols:this._getCols(); $cols.unbind('hover.animation'); }; ptsBlock_price_table.prototype.getColSelectors=function(){ return { header: {sel: '.ptsColHeader'} , desc: {sel: '.ptsColDesc'} , rows: {sel: '.ptsRows'} , cells: {sel: '.ptsCell'} , footer: {sel: '.ptsColFooter'}};}; ptsBlock_price_table.prototype.getMaxColsSizes=function(widthDesc){ var $cols=this._getCols(widthDesc) , sizes=this.getColSelectors(); $cols.each(function(){ jQuery(this).css({'min-height':'auto'}); for(var key in sizes){ if(key=='rows') continue; var $entity=jQuery(this).find(sizes[ key ].sel); if($entity&&$entity.size()){ if(key=='cells'){ if(!sizes[ key ].height) sizes[ key ].height=[]; var cellNum=0; $entity.each(function(){ var prevHeight=jQuery(this).outerHeight(); jQuery(this).css('height', 'auto'); var height=jQuery(this).outerHeight(); if(!sizes[ key ].height[ cellNum ]||sizes[ key ].height[ cellNum ] < height){ sizes[ key ].height[ cellNum ]=height; } cellNum++; }); }else{ var prevHeight=$entity.outerHeight(); $entity.css('height', 'auto'); var height=$entity.outerHeight(); if(!sizes[ key ].height||sizes[ key ].height < height){ sizes[ key ].height=height; } $entity.outerHeight(prevHeight); }} }}); return sizes; }; ptsBlock_price_table.prototype.getColumnWithInfo=function(strWidthAttr){ var trimAttr=strWidthAttr.trim(); var number=trimAttr.match('\\d+'); var isPerc=trimAttr.match('%'); var isPx=trimAttr.match('\\d+'); if(number===null||(isPerc===null&&isPx===null)){ return null; } return new Object({ 'num': (number.length&&number.length > 0&&!isNaN(parseInt(number[0]))) ? parseInt(number[0]):null, 'isPerc': isPerc===null ? false:true }); }; ptsBlock_price_table.prototype.setColsWidth=function(width, perc){ var thatObj=this; if(thatObj.getParam('is_horisontal_row_type')!='1'){ if(this.getParam('dsbl_responsive')==='1'){ var tableWidth=this._$.width(), fixedValueTableWidth=this._$.width(), $cols=this._getCols(true), notSettedColumnWidthArr=new Array(); $cols.each(function (){ var col1=jQuery(this); if(col1.length > 0&&col1[0].style&&col1[0].style.width){ var colWidthObj=thatObj.getColumnWithInfo(col1[0].style.width); if(colWidthObj&&'num' in colWidthObj&&'isPerc' in colWidthObj){ var calcColWidth=0; if(colWidthObj.isPerc){ calcColWidth=fixedValueTableWidth * colWidthObj.num / 100; }else{ calcColWidth=colWidthObj.num; } var colPdL=parseFloat(col1.css('padding-left')), colPdR=parseFloat(col1.css('padding-right')), colMgL=parseFloat(col1.css('margin-left')), colMgR=parseFloat(col1.css('margin-right')), colSumMarginPadding=0; if(!isNaN(colPdL)){ colSumMarginPadding +=colPdL; } if(!isNaN(colPdR)){ colSumMarginPadding +=colPdR; } if(!isNaN(colMgL)){ colSumMarginPadding +=colMgL; } if(!isNaN(colMgR)){ colSumMarginPadding +=colMgR; } tableWidth -=calcColWidth; calcColWidth=Math.floor(calcColWidth - colSumMarginPadding); if(calcColWidth < 0){ calcColWidth=0; } col1.width(calcColWidth); }else{ notSettedColumnWidthArr[notSettedColumnWidthArr.length]=col1; }}else{ notSettedColumnWidthArr[notSettedColumnWidthArr.length]=col1; }}); if(tableWidth > 0&¬SettedColumnWidthArr.length > 0){ var calcWidthForNsCol=Math.round(tableWidth / notSettedColumnWidthArr.length); for (var oneNsColumn in notSettedColumnWidthArr){ notSettedColumnWidthArr[oneNsColumn].width(calcWidthForNsCol); }} }else{ width=parseFloat(width); if(width){ if(!perc){ this.setParam('col_width', width); } var $cols=this._getCols(true); if(perc){ width +='%'; }else{ width +='px'; } $cols.css({ 'width': width }); }} }else{ this.columnChidrensWidthCalc(); }}; ptsBlock_price_table.prototype.columnChidrensWidthCalc=function(){ if(this.getParam('is_horisontal_row_type')!='1'){ return; } var $cols=this._getCols(true); $cols.each(function (ind, oneCol){ var currColumn=jQuery(oneCol) , emptyChilds=currColumn.find('.ptsTableElementContent').children(':not(:has(">div")):not(".ptsColBadge")') , level1Childs=currColumn.find('.ptsTableElementContent').children(':has(">div"):not(".ptsColBadge")') , level1ChildRows=currColumn.find('.ptsTableElementContent').children('.ptsRows') , level2ChildRows=level1ChildRows.children() , allChildCount=level1Childs.length , level2ChildCount=1; if(level1ChildRows.length > 0&&level2ChildRows.length > 0){ allChildCount +=level2ChildRows.length -1; level2ChildCount=level2ChildRows.length; } emptyChilds.css({ 'width': "0%", 'margin': '0', 'padding': '0', }); var oneChildWidth=Math.floor(95 / allChildCount); level1Childs.css('width', oneChildWidth + '%'); var widthInPixel=level1Childs.css('width'); level1ChildRows.css('width', (level2ChildCount*oneChildWidth+2) + '%'); level2ChildRows.css('width', widthInPixel); }); } ptsBlock_price_table.prototype.checkColWidthPerc=function(){ if(this.getParam('calc_width')==='table'){ this.setColWidthPerc(); }}; ptsBlock_price_table.prototype.setColWidthPerc=function(){ var $cols=this._getCols(parseInt(this.getParam('enb_desc_col'))); this.setColsWidth(100 / $cols.size(), true); }; ptsBlock_price_table.prototype.setTableWidth=function(width, measure){ if(width&&parseInt(width)){ width=parseInt(width); this.setParam('table_width', width); }else{ width=this.getParam('table_width'); } if(measure){ this.setParam('table_width_measure', measure); }else{ measure=this.getParam('table_width_measure'); } this._$.width(width+ measure); }; ptsBlock_price_table.prototype.setTableVertPadding=function(padding, measure){ if(padding&&parseInt(padding)){ padding=parseInt(padding); this.setParam('vert_padding', padding); }else{ padding=this.getParam('vert_padding'); } if(measure){ this.setParam('vert_padding_measure', measure); }else{ measure=this.getParam('vert_padding_measure'); } this._$.find('.ptsCol').css('paddingBottom', padding + 'px'); }; ptsBlock_price_table.prototype.setCalcWidth=function(type){ if(type){ this.setParam('calc_width', type); }else{ type=this.getParam('calc_width'); } switch(type){ case 'table': this.setTableWidth(); this.setColWidthPerc(); break; case 'col': var enb_desc_col=this.getParam('enb_desc_col')!=0 ? true:false; this._$.width(this._getCols(enb_desc_col).size() * this.getParam('col_width')); this.setColsWidth(this.getParam('col_width')); break; }}; ptsBlock_price_table.prototype._fixResponsive=function(){ if(this.getParam('is_horisontal_row_type')=='1'){ var $parent=this._$.parents('.ptsTableFrontedShell:first').parent() , parentWidth=$parent.width(); if(jQuery(window).width() < 600){ $parent.addClass('ptsResponcive'); }else{ $parent.removeClass('ptsResponcive'); } return; } var $parent=this._$.parents('.ptsTableFrontedShell:first').parent() , parentWidth=$parent.width() , widthMeasure=this.getParam('table_width_measure') , calcWidth=this.getParam('calc_width') , includeDesc=parseInt(this.getParam('enb_desc_col')) , $cols=this._getCols(includeDesc) , actualTblWidth=this._$.width() , criticalColWidth=isNaN(parseInt(this.getParam('resp_min_col_width'))) ? 150:parseInt(this.getParam('resp_min_col_width')) , dsblResponsive=parseInt(this.getParam('dsbl_responsive')); this._$.removeClass('ptsBlockMobile'); switch(calcWidth){ case 'table': switch(widthMeasure){ case '%': var self=this , removeOtherDescCol=function (){ if(!dsblResponsive && !_ptsIsEditMode() && self._$.find('.ptsTableDescCol').size() > 1 && includeDesc ){ var $descCols=self._$.find('.ptsTableDescCol') , firstCol=false; $descCols.each(function (){ var $this=jQuery(this); if(! firstCol){ firstCol=true; return; } $this.remove(); }); }}; $cols=this._getCols(includeDesc); var descColNum=$cols.filter('.ptsTableDescCol').length; var colsNum=$cols.length - (descColNum > 1 ? descColNum - 1:0) , currWidth=actualTblWidth / colsNum; if(currWidth <=criticalColWidth&&!dsblResponsive){ $cols.css('width', '100%'); if(!_ptsIsEditMode()&&includeDesc){ var $descColumn=this._$.find('.ptsTableDescCol').first() , $columns=this._$.find('.ptsCol:not(.ptsTableDescCol)') , firstCol=false; removeOtherDescCol(); var i=0; $columns.each(function (){ var $this=jQuery(this); if(! firstCol){ firstCol=true; return; } i++; var $descClone=$descColumn.clone(); $descClone.find('.tooltipstered[data-title]').removeClass('tooltipstered').each(function (){ var el=jQuery(this); el.attr('title', el.attr('data-title')).removeAttr('data-title'); }); $descClone.insertBefore($this); }); this._initTooltipsForCells(); this._isResponsiveDescInit=true; this._$.find('.ptsCol').css('width', '50%'); } this._$.addClass('ptsBlockMobile'); this.setParam('went_to_responsive', 1); }else{ removeOtherDescCol(); if(this.getParam('went_to_responsive')){ this.setColWidthPerc(); this.setParam('went_to_responsive', 0); }} break; case 'px': if(actualTblWidth > parentWidth){ this.setParam('went_to_responsive', this.getParam('table_width')); this.setTableWidth(100, '%'); this._fixResponsive(); }else if(this.getParam('went_to_responsive')){ this.setTableWidth(this.getParam('went_to_responsive'), 'px'); this.setParam('went_to_responsive', 0); } break; } break; case 'col': var colsNum=$cols.size() , currWidth=parseFloat(this.getParam('col_width')); if(currWidth * colsNum >=parentWidth){ this.setParam('went_to_responsive', currWidth); this.setParam('table_width', 100); this.setParam('table_width_measure', '%'); this.setCalcWidth('table'); this._fixResponsive(); }else if(this.getParam('went_to_responsive')){ this.setCalcWidth('col'); this.setParam('col_width', this.getParam('went_to_responsive')); this.setParam('went_to_responsive', 0); } break; }}; ptsBlock_price_table.prototype._refreshCellsHeight=function(){ var $cols=this._getCols(true) , self=this , sizes=this.getMaxColsSizes(true); $cols.each(function(){ for(var key in sizes){ var $entity=jQuery(this).find(sizes[ key ].sel); if(self.getParam('is_horisontal_row_type')=='1'){ $entity.css({'height': 'auto'}); }else{ if(key=='rows'){ $entity.css({'height': 'auto'}); continue; } if($entity&&$entity.size()){ if(key=='cells'){ var cellNum=0; $entity.each(function(){ jQuery(this).css('height', sizes[ key ].height[ cellNum ]); cellNum++; }); }else{ $entity.outerHeight(sizes[ key ].height); if($entity.outerHeight()!=sizes[ key ].height){ $entity.css('height', sizes[ key ].height); }} }} }}); }; function ptsElementBase(jqueryHtml, block){ this._iterNum=0; this._id='el_'+ mtRand (1, 999999); this._animationSpeed=g_ptsAnimationSpeed; this._$=jqueryHtml; this._block=block; if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId=''; } this._innerImgsCount=0; this._innerImgsLoaded=0; this._menu=null; this._menuClbs={}; if(typeof(this._menuClass)==='undefined'){ this._menuClass='ptsElementMenu'; } this._menuOnBottom=false; this._code='base'; this._initedComplete=false; this._editArea=null; if(typeof(this._isMovable)==='undefined'){ this._isMovable=false; } this._moveHandler=null; this._sortInProgress=false; if(typeof(this._showMenuEvent)==='undefined'){ this._showMenuEvent='click'; } if(typeof(this._changeable)==='undefined'){ this._changeable=false; } if(g_ptsEdit){ this._init(); this._initMenuClbs(); this._initMenu(); var images=this._$.find('img'); if(images&&(this._innerImgsCount=images.size())){ this._innerImgsLoaded=0; var self=this; images.load(function(){ self._innerImgsLoaded++; if(self._$.find('img').size()==self._innerImgsLoaded){ self._afterFullContentLoad(); }}); }} this._onlyFirstHtmlInit(); this._initedComplete=true; } ptsElementBase.prototype.getId=function(){ return this._id; }; ptsElementBase.prototype.getBlock=function(){ return this._block; }; ptsElementBase.prototype._onlyFirstHtmlInit=function(){ if(this._$&&!this._$.data('first-inited')){ this._$.data('first-inited', 1); return true; } return false; }; ptsElementBase.prototype.setIterNum=function(num){ this._iterNum=num; this._$.data('iter-num', num); }; ptsElementBase.prototype.getIterNum=function(){ return this._iterNum; }; ptsElementBase.prototype.$=function(){ return this._$; }; ptsElementBase.prototype.getCode=function(){ return this._code; }; ptsElementBase.prototype._setCode=function(code){ this._code=code; }; ptsElementBase.prototype._init=function(){ this._beforeInit(); }; ptsElementBase.prototype._beforeInit=function(){ }; ptsElementBase.prototype.destroy=function(){ }; ptsElementBase.prototype.get=function(opt){ return jQuery('
').html(this._$.attr('data-'+ opt)).text(); }; ptsElementBase.prototype.set=function(opt, val){ this._$.attr('data-'+ opt, jQuery('
').text(val).html()); }; ptsElementBase.prototype._getEditArea=function(){ if(!this._editArea){ this._editArea=this._$.children('.ptsElArea'); if(!this._editArea.size()){ this._editArea=this._$.find('.ptsInputShell'); }} return this._editArea; }; ptsElementBase.prototype._getOverlay=function(){ return this._$.find('.ptsElOverlay'); }; function ptsElement_btn(jqueryHtml, block){ if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId='ptsElMenuBtnExl'; } this._menuClass='ptsElementMenu_btn'; this._haveAdditionBgEl=null; this._changeable=true; this.includePostLinks=true; ptsElement_btn.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_btn, ptsElementBase); ptsElement_btn.prototype._onlyFirstHtmlInit=function(){ if(ptsElement_btn.superclass._onlyFirstHtmlInit.apply(this, arguments)){ if(this.get('customhover-clb')){ var clbName=this.get('customhover-clb'); if(typeof(this[clbName])==='function'){ var self=this; this._getEditArea().hover(function(){ self[clbName](true, this); }, function(){ self[clbName](false, this); }); }} }}; ptsElement_btn.prototype._hoverChangeFontColor=function(hover, element){ if(hover){ jQuery(element) .data('original-color', this._getEditArea().css('color')) .css('color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); }else{ jQuery(element) .css('color', jQuery(element).data('original-color')); }}; ptsElement_btn.prototype._hoverChangeBgColor=function(hover, element){ var parentElement=jQuery(element).parents('.ptsEl:first'); if(hover){ parentElement .data('original-color', parentElement.css('background-color')) .css('background-color', parentElement.attr('data-bgcolor')); }else{ parentElement .css('background-color', parentElement.data('original-color')); }}; ptsElement_btn.prototype._hoverBorderColor=function(hover, element){ if(hover){ jQuery(element) .data('original-color', jQuery(element).css('border-color')) .css('border-color', jQuery(element).parents('.ptsEl:first').attr('data-bgcolor')); }else{ jQuery(element) .css('border-color', jQuery(element).data('original-color')); }}; function ptsElement_table_col(jqueryHtml, block){ if(typeof(this._menuOriginalId)==='undefined'){ this._menuOriginalId='ptsElMenuTableColExl'; } if(typeof(this._menuClass)==='undefined'){ this._menuClass='ptsElementMenu_table_col'; } if(typeof(this._isMovable)==='undefined'){ this._isMovable=true; } this._showMenuEvent='hover'; this._colNum=0; ptsElement_table_col.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_table_col, ptsElementBase); ptsElement_table_col.prototype.setIterNum=function(){ ptsElement_table_col.superclass.setIterNum.apply(this, arguments); if(!g_ptsEdit&&typeof(ptsScheduleCheck)!=='undefined'){ ptsScheduleCheck(this); }}; function ptsElement_table_col_desc(jqueryHtml, block){ this._isMovable=false; ptsElement_table_col_desc.superclass.constructor.apply(this, arguments); /*this.getBlock().$().bind('ptsBlockContentChanged', function(){ self.refreshHeight(); });*/ } extendPts(ptsElement_table_col_desc, ptsElement_table_col); /*ptsElement_table_col_desc.prototype.refreshHeight=function(){ var sizes=this.getBlock().getMaxColsSizes(); for(var key in sizes){ var $entity=this._$.find(sizes[ key ].sel); if($entity&&$entity.size()){ if(key=='cells'&&sizes[ key ].height){ var cellNum=0; $entity.each(function(){ if(typeof(sizes[ key ].height[ cellNum ])!=='undefined'){ jQuery(this).css('height', sizes[ key ].height[ cellNum ]); } cellNum++; }); }else{ $entity.css('height', sizes[ key ].height); }} }};*/ function ptsElement_table_cell_txt(jqueryHtml, block){ if(block.getParam('responsive_text')){ jqueryHtml.find('span, p').responsiveText({ minFontSize: 14 }); } this.includePostLinks=true; ptsElement_table_cell_txt.superclass.constructor.apply(this, arguments); } extendPts(ptsElement_table_cell_txt, ptsElementBase); (function ($){ 'use strict'; $.fn.sModal=function(options){ var self=this, settings=$.extend({ width: 640, height: 480, buttons: [], }, options), $modalOverlay, $modalContainer, $closeModalButton, $modalContent, $modalButtons, modalOverlayStyle={ position: 'fixed', top: 0, left: 0, background: 'rgba(0,0,0,.75)', width: '100%', height: '100%', 'z-index': '100000', display: 'none', 'overflow-y': 'auto', }, modalContainerStyle={ width: settings.width, position: 'absolute', top: '50%', left: '50%', 'max-width': 'calc(100% - 1.5em)', 'margin-right': '-50%', 'margin-bottom': '20px', transform: 'translate(-50%, -50%)', background: '#fff', padding: '1em', }, modalContentStyle={ height: 'calc(100% - 3.6em)', 'overflow-y': 'auto', 'overflow-x': 'hidden', padding: '1em', }, closeButtonStyle={ position: 'absolute', right: '10px', top: '10px', 'font-size': '35px', color: '#fff', cursor: 'pointer', }, modalButtonsStyle={ position: 'relative', width: '100%', 'text-align': 'right', 'margin-top': '1em', }; function closeModal(){ self.trigger('close.before'); if(jQuery('.sModal:visible').length < 2){ jQuery('body').css('overflow', 'auto'); } $modalOverlay.fadeOut(); self.trigger('close.after'); } function openModal(){ jQuery('body').css('overflow', 'hidden'); $modalOverlay.show(0, function(){ resizeModal(); $modalOverlay.hide().fadeIn(); }); if(parseInt(jQuery('.sc-modal-container').css('top')) > jQuery(window).height()){ var offset=jQuery(window).height() / 2 + 40; jQuery('.sc-modal-container').css('top' , offset); }} function resizeModal(){ var offset='50%'; if($modalContainer.height() > jQuery(window).height()){ offset=$modalContainer.height() / 2 + 40; } $modalContainer.css('top', offset); } function createInstance($modalTemplate){ $modalOverlay=jQuery('
').css(modalOverlayStyle); $modalContainer=jQuery('
').css(modalContainerStyle); $closeModalButton=jQuery('
×
').css(closeButtonStyle); $closeModalButton.appendTo($modalOverlay); $modalContent=jQuery('
').css(modalContentStyle); $modalContent.appendTo($modalContainer); $modalTemplate.appendTo($modalContent).show(); $modalContainer.appendTo($modalOverlay); $modalOverlay.appendTo('body'); $modalOverlay.add($closeModalButton).on('click', function(event){ if(jQuery(this).is(jQuery(event.target))){ closeModal(); }}); jQuery(document).on('keyup', function(event){ if(event.which==27&&$modalOverlay.is(':visible')){ closeModal(); }}); var resizeTimer; jQuery(window).on('resize', function(event){ clearTimeout(resizeTimer); resizeTimer=setTimeout(function(){ resizeModal(); }, 250); }); if(settings.buttons.length > 0){ $modalButtons=jQuery('
').css(modalButtonsStyle); for (var i=0; i < settings.buttons.length; i++){ jQuery('',nextArrow:'',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(b,c){return a('